#include <iostream>
#include <string>
#include <vector>

class Shape
{
protected:
    double x,y;
    std::string color;
public:
    Shape(double x, double y, std::string& color)
    {
        Shape::x = x;
        Shape::y = y;
        Shape::color = color;
    }
    virtual Shape* clone() = 0;
    virtual void printInfo() = 0;
};

class Rectangle :public Shape
{
private:
    double width, height;
public:
    Rectangle(double x, double y, double width, double height, std::string color)
    :Shape(x, y, color)
    {
        Rectangle::width = width;
        Rectangle::height = height;
    }
    Shape* clone()
    {
        return new Rectangle(*this);
    }
    void printInfo()
    {
        std::cout<<"Rectangle("<<x<<","<<y<<","<<width<<","<<height<<","<<color<<")"<<std::endl;
    }
};

class CirCle :public Shape
{
private:
    double radius;
public:
    CirCle(double x, double y, double radius, std::string color)
    :Shape(x, y, color)
    {
        CirCle::radius = radius;
    }
    Shape* clone()
    {
        return new CirCle(*this);
    }
    void printInfo()
    {
        std::cout<<"CirCle("<<x<<","<<y<<","<<radius<<","<<color<<")"<<std::endl;
    }
};

int main() {
    CirCle* cirCle  = new CirCle(0,0,100,"red");
    Rectangle* rectangle = new Rectangle(0, 0, 100, 100,"red");
    std::vector<Shape*> list;
    list.push_back(cirCle);
    list.push_back(rectangle);
    std::vector<Shape*> list2;
    for(auto l : list)
    {
        list2.push_back(l->clone());
    }
    for(auto l : list2)
    {
        l->printInfo();
    }
    return 0;
}

